package cn.yunhe.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.yunhe.dao.SuppDao;
import cn.yunhe.entity.Drug;
import cn.yunhe.entity.Supp;
import cn.yunhe.service.SuppService;

@Service("suppService")
public class SuppServiceImpl implements SuppService {
	@Autowired
	private SuppDao suppDao;

	// 查询供应商所有信息
	@Override
	public List<Supp> selectSupp() {
		return suppDao.selectSupp();
	}

	public SuppDao getSuppDao() {
		return suppDao;
	}

	public void setSuppDao(SuppDao suppDao) {
		this.suppDao = suppDao;
	}

	// 模糊查询供应商信息,按姓名name查询
	@Override
	public List<Supp> selectMoHuSupp(String pname) {

		return suppDao.selectMoHuSupp(pname);
	}

	// 连表查询,查询供应商下 提供的药品名称
	@Override
	public List<Drug> selectSuppAndTypeAndDrug(String pname) {

		return suppDao.selectSuppAndTypeAndDrug(pname);
	}

	@Override
	public int insertSupp(Supp supp) {
		return suppDao.insertSupp(supp);
	}

	@Override
	public int updateSupp(Supp supp) {
		return suppDao.updateSupp(supp);
	}

	@Override
	public int updatePstateSupp(Supp supp) {

		return suppDao.updatePstateSupp(supp);
	}

}
